<template>
  <topTitle />
  <div class="app-main">
    <router-view v-slot="{ Component }">
      <keep-alive v-if="route.meta.keepAlive">
        <component :is="Component" />
      </keep-alive>
      <component :is="Component" v-else />
    </router-view>
  </div>
  <tabbar />
</template>

<script lang="ts">
  import { defineComponent } from 'vue'
  import { useRoute } from 'vue-router'
  import tabbar from '@/components/Tabbar/index.vue'
  import topTitle from '@/components/TopTitle/index.vue'

  export default defineComponent({
    name: 'App',
    components: { tabbar, topTitle },
    setup() {
      const route = useRoute()
      return {
        route
      }
    }
  })
</script>

<style lang="scss" scoped>
  .app-main {
    padding-bottom: 50px;
  }
</style>
